package com.tianhua.javs.core.parse;

import com.tianhua.javs.client.bean.DomainModelBean;
import com.tianhua.javs.client.bean.JavsSegmentBean;
import com.tianhua.javs.client.bean.JavsShellVarBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Description:
 * date: 2022/2/10
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Component(value = "javsKeyWardParseServiceImpl")
public class JavsKeyWardParseServiceImpl implements KeyWardParseService {

    @Autowired
    private JavsShellParseService javsShellParseService;

    @Override
    public JavsSegmentBean parse(DomainModelBean domainModelBean, String javsShellRowContent) {
        List<JavsShellVarBean> javsShellVarBeanList = javsShellParseService.parseJavsShellRow(javsShellRowContent);
        for (int i =0;i<javsShellVarBeanList.size();i++ ){

            JavsShellVarBean javsShellVarBean = javsShellVarBeanList.get(i);
            //javs关键字处理
            if(javsShellVarBean.isJavsKeyWard()){
                javsShellVarBean.getVarCode();
            }
            //业务关键字处理
            if(javsShellVarBean.isBusinessKeyWard()){
                javsShellVarBean.getVarCode();
            }
            else {
                //java 原生变量处理

            }
        }
        return null;
    }
}
